Conversation
ggamnunq
reviewed
Oct 30, 2025
| * (작성자(User) 엔티티까지 한 번에 가져오기) | ||
| */ | ||
| @EntityGraph(attributePaths = {"user"}) // Review의 user 필드 fetch join | ||
| List<Review> findAllByStoreOrderByCreatedAtDesc(Store store); |
There was a problem hiding this comment.
fetch join하는 jpql query를 직접 작성해보면 좋을 것 같습니다
ggamnunq
reviewed
Oct 30, 2025
| * 4. 홈화면 대시보드 조회 | ||
| * - 최근 리뷰한 가게 지역 + 포인트 + 알람 여부 + 완료 미션 수 | ||
| */ | ||
| @Query(""" |
There was a problem hiding this comment.
해당 부분 서브쿼리가 아닌 조인으로도 구현 가능할 것 같습니다.
서브쿼리는 예상치 못하게 다량의 쿼리가 발생할 수 있고, 성능 또한 조인이 일반적으로 더 좋습니다.
개인적으로 조인하는 방법을 추천합니다.
또한 Left, Right 조인도 적극 활용해보면 좋을듯 합니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.